<?php

namespace App\Http\Middleware;

use App\Models\Config;
use Closure;

class HomeConfig
{
    public function handle($request, Closure $next)
    {
        view()->share('configs',$this->getConfigs());
        return $next($request);
    }


    protected function getConfigs(){
        $configs = Config::pluck('setting','name')->toArray();
        $config = array_merge($configs['base'],$configs['integral']);
        return $config;

    }
}
